package xx.pro.consumer.listener;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import static xx.pro.common.constans.Constants.DIRECT_QUEUE;

@Slf4j
@Component
public class DirectConsumer {

    @RabbitListener(queues = DIRECT_QUEUE)
    public void directConsumer(Message message) {
        String msg = new String(message.getBody());
        log.info("Direct Consumer 接收到消息:{}", msg);
    }
}
